package com.authine.cloudpivot.app.openapi.executor;

import com.alibaba.cola.dto.Response;
import com.authine.cloudpivot.app.openapi.dto.DeleteGatewayCmd;
import com.authine.cloudpivot.app.openapi.domain.Route;
import org.springframework.stereotype.Component;

/**
 * @author carter
 * create_date  2020/6/5 11:28
 * description     删除网关执行器
 */
@Component
public class DeleteGatewayCmdExe {

    private final Route route;

    public DeleteGatewayCmdExe(Route route) {
        this.route = route;
    }

    public Response execute(DeleteGatewayCmd cmd) {
        route.deleteRoute(cmd.getId());
        return Response.buildSuccess();
    }
}
